package com.gyy.androidlibraryapp;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.FrameLayout;

import com.gyy.androidlibraryapp.fragments.CircleImageFragment;
import com.ymdd.library.navigateTabBar.widget.MainNavigateTabBar;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 演示 凸起按钮显示在mainTabBar的里面
 */
public class TabActivity extends AppCompatActivity {

    @BindView(R.id.main_container)
    FrameLayout mainContainer;
    @BindView(R.id.mainTabBar)
    MainNavigateTabBar mNavigateTabBar;

    //标题集合
    private int[] msgResId = new int[]{
            R.string.tab_work,
            R.string.tab_management,
            R.string.tab_scan,
            R.string.tab_message,
            R.string.tab_setting};
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tab);
        ButterKnife.bind(this);
        //初始化tab
        initTab();
    }

    //初始化tab
    private void initTab() {
        mNavigateTabBar.addTab(CircleImageFragment.class, new MainNavigateTabBar.TabParam(R.mipmap.ic_tab_work_un_select, R.mipmap.ic_tab_work_select, msgResId[0]));
        mNavigateTabBar.addTab(CircleImageFragment.class, new MainNavigateTabBar.TabParam(R.mipmap.ic_tab_manage_un_select, R.mipmap.ic_tab_manage_select, msgResId[1]));
        mNavigateTabBar.addTab(null, new MainNavigateTabBar.TabParam(0, 0, " "));
        mNavigateTabBar.addTab(CircleImageFragment.class, new MainNavigateTabBar.TabParam(R.mipmap.ic_tab_message_un_select, R.mipmap.ic_tab_message_select, msgResId[3]));
        mNavigateTabBar.addTab(CircleImageFragment.class, new MainNavigateTabBar.TabParam(R.mipmap.ic_tab_setting_un_select, R.mipmap.ic_tab_setting_select, msgResId[4]));
    }

}
